package com.mushuilingfeng.ddd.user.base;

import cn.hutool.extra.spring.SpringUtil;
import com.mushuilingfeng.ddd.user.domain.base.BusinessException;
import com.mushuilingfeng.ddd.user.domain.base.service.Ii8nService;

/**
 * @author 沐水淋风
 * @date 2024/10/13
 */
public final class BusinessErrors {
    private static class Ii8nBusinessException extends BusinessException {
        private final String code;
        
        public Ii8nBusinessException(String code) {
            super(-1, "");
            this.code = code;
        }
        
        @Override
        public String getErrorMsg() {
            return SpringUtil.getBean(Ii8nService.class).getMessage(code, "");
        }
    }
    
    public final static BusinessException TOKEN_NOT_EXIST = new Ii8nBusinessException("error.token.notExist");
}
